
package at.fhj.itm.metadata.impl.postgres;

import java.io.IOException;
import java.io.InputStream;

import java.util.Properties;

/**
 *
 * @author Seuchter
 */
class MetadataQueries
{

    private static final String PROPERTIES_FILE = "metadata-quries.properties";
    private static Properties queries;

    protected  static Properties getQueries()
    {
        if (queries == null)
        {
            try
            {
                Properties props = new Properties();
                InputStream stream = MetadataQueries.class.getResourceAsStream(PROPERTIES_FILE);
                props.load(stream);
                stream.close();

                queries = props;
            }
            catch (IOException io)
            {
                return null;
            }

        }
        return queries;
    }

    protected  MetadataQueries()
    {
    }

    protected  static String getQuery(final String querry)
    {
        String rawQuery =  getQueries().getProperty(querry);
        return rawQuery;

    }
}
